#import "WechatpayDemoPlugin.h"
#import "WechatAuthSDK.h"
#import "WXApiManager.h"
#import "WXApiRequestHandler.h"
#import "WXApiResponseHandler.h"
#import "WXApi.h"
#import "WXApiObject.h"
#import "WechatAuthSDK.h"
@implementation WechatpayDemoPlugin {
    WechatAuthSDK* _weChatPay;
}
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
  FlutterMethodChannel* channel = [FlutterMethodChannel
      methodChannelWithName:@"wechatpay_demo_plugin"
            binaryMessenger:[registrar messenger]];
  WechatpayDemoPlugin* instance = [[WechatpayDemoPlugin alloc] init];
  [WXApiManager sharedManager].delegate = instance;
  [registrar addMethodCallDelegate:instance channel:channel];
}

- (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
  _weChatPay = [[WechatAuthSDK alloc]init];
  [_weChatPay Auth:@"auth" nonceStr:@"nonceStr" timeStamp:@"timeStamp" scope:@"scope" signature:@"signature" schemeData:@"schemeData"];
  if ([@"getPlatformVersion" isEqualToString:call.method]) {
    result([@"iOS " stringByAppendingString:[[UIDevice currentDevice] systemVersion]]);
  } else {
    result(FlutterMethodNotImplemented);
  }
}

@end
